package com.thd.springboottest.ioc.ymlinject;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "user")
public class YmlInjectByAnnotationConfigurationProperties {

    private String name;

    private Integer age = 5;

    public void say(){
        System.out.println("YmlInjectByAnnotationConfigurationProperties.say() ");
        System.out.println(this.name + " said : i'm " + this.age + " years old" );
    }
}
